<div class="app-body">
    <main class="main d-flex align-items-center">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-md-6 mx-auto">
                    <div class="card">
                        <div class="card-body p-4">
                            <form>
                                <h1>{{ 'register.REGISTER' | translate }}</h1>
                                <p class="text-muted">{{ 'register.CREATE-ACCOUNT' | translate }}</p>
                                <div class="col-sm-12">
                                     <div class="text-center" *ngIf="model.picture" >
                                        <img class="img-fluid img-circle" [src]="model.picture" />
                                    </div>
                                </div>
                                <div class="input-group mb-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="icon-user"></i></span>
                                    </div>
                                    <input type="text" class="form-control" placeholder="Name" name="name" autocomplete="cc-name" [(ngModel)]="model.name" required>
                                </div>
                                <div class="input-group mb-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="icon-user"></i></span>
                                    </div>
                                    <input type="text" class="form-control" placeholder="Username" name="username" autocomplete="username" [(ngModel)]="model.username"
                                        (keyup)="checkIfUniquenameExists()" (blur)="checkIfUniquenameExists()" [ngClass]="getClassUsernameExist()"
                                        required>
                                </div>
                                <div class="input-group mb-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text">@</span>
                                    </div>
                                    <input type="text" class="form-control" placeholder="Email" name="email" autocomplete="email" [(ngModel)]="model.email" (keyup)="checkIfEmailExists()"
                                        (blur)="checkIfEmailExists()" [ngClass]="getClassEmailExist()" required>
                                </div>
                                <div class="input-group mb-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="fa fa-phone"></i></span>
                                    </div>
                                    <input type="text" class="form-control" placeholder="Phone Number" mask="(000) 000-0000}" name="phoneNumber" autocomplete="tel" [(ngModel)]="model.phoneNumber"
                                        required>
                                </div>
                                <div class="input-group mb-3">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="icon-lock"></i></span>
                                    </div>
                                    <input type="password" class="form-control" placeholder="Password" name="password" autocomplete="new-password" [(ngModel)]="model.password"
                                        required>
                                </div>
                                <div class="input-group mb-4">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="icon-lock"></i></span>
                                    </div>
                                    <input type="password" class="form-control" placeholder="Repeat password" name="confirmPassword" autocomplete="new-password"
                                        [(ngModel)]="model.confirmPassword" required>
                                </div>
                                <button type="button" class="btn btn-block btn-success" (click)="register()">{{ 'register.CREATE-ACCOUNT' | translate }}</button>
                                <hr>
                                <div *ngIf="errors.length > 0">
                                    <alert type="danger">
                                        <div *ngFor="let error of errors; let i = index"><strong>{{i+1}}</strong> {{error}}</div>
                                    </alert>
                                </div>
                            </form>
                        </div>
                        <div class="card-footer p-4" *ngIf="!socialLoggedIn">
                            <div class="row">
                                <div class="col-md-4 col-xs-6">
                                    <button type="button" (click)="socialSignIn('facebook')" class="btn btn-brand btn-facebook" style="margin-bottom: 4px">
                                        <i class="fa fa-facebook"></i>
                                        <span>{{ 'register.FACEBOOK' | translate }}</span>
                                    </button>
                                </div>
                                <!-- <div class="col-4" *ngIf="loginInfo?.showProvider('Twitter')">
                  <button type="button" class="btn btn-brand btn-twitter" style="margin-bottom: 4px">
                    <i class="fa fa-twitter"></i>
                    <span>Twitter</span>
                  </button>
                </div> -->
                                <div class="col-md-4 col-xs-6">
                                    <button type="button" (click)="socialSignIn('google')" class="btn btn-brand btn-google-plus" style="margin-bottom: 4px">
                                        <i class="fa fa-google-plus"></i>
                                        <span>{{ 'register.GOOGLE+' | translate }}</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
</div>